<template>
  <ZSuperQuery class="vxe-super-query" title="高级查询" @handleSuperQuery="handleClick" :fieldList="toolbarProps.fieldList">
    <template v-slot:button="{isActive,open,reset}">
      <a-button v-if="!isActive" shape="circle" icon="search"  @click="open()"></a-button>
      <a-tooltip :mouseLeaveDelay="0.2" v-else>
        <template slot="title">
          <span>已有高级查询条件生效</span>
          <a-divider type="vertical"/>
          <a @click="reset">清空</a>
        </template>
        <a-button  shape="circle"  @click="open"><a-icon type="sync" style="color:#2a7dc9" spin/></a-button>
      </a-tooltip>
    </template>
  </ZSuperQuery>
</template>

<script>
import ZSuperQuery from '@/components/zz/ZSuperQuery'
export default {
  name: 'VxeToolbarSearch',
  components: { ZSuperQuery },
  props: {
    renderOptions: Object,
    params: Object,
    toolbarProps: {
      type: Object,
      default: () => { }
    }
  },
  data() {
    return {}
  },
  methods: {
    handleClick(params) {
      const { events = {}} = this.renderOptions
      // const { button, $grid } = this.params
      events.click && events.click(params)
    }
  }

}
</script>
<style lang="less" >
.z-vxe-toolbar{
  .vxe-super-query{
    .ant-btn{
      height:30px;
      width:30px;
      i{
        font-size: 14px;
      }
    }
  }
}
</style>
